package com.region.http.client.request;

import com.region.core.annotation.Region;
import com.region.http.client.annotation.configurer.ParameterConstant;
import com.region.http.client.annotation.configurer.ParameterConstant.ParameterConstantEntry;
import com.region.http.client.annotation.parameter.Body;
import com.region.http.client.annotation.parameter.ParamKey;
import com.region.http.client.annotation.parameter.PathKey;
import com.region.http.client.annotation.request.GetUrl;
import com.region.http.client.annotation.request.PutUrl;
import com.region.http.client.common.ContentType;
import com.region.http.client.entity.ResultVO;
import com.region.http.client.entity.User;

/**
 * @author 26225
 * @date 2024/9/1 19:06
 * @description
 */
@Region(value = "https://127.0.0.1:9999/springmvc")
public interface ConstRequest {

    @ParameterConstant(
            headers = {@ParameterConstantEntry(key = "Token", value = "xxxxxxx")},
            params = {@ParameterConstantEntry(key = "length", value = "8")}
    )
    @GetUrl(value = "/app/getRandomString")
    String getRandomString(@ParamKey("length") int length);

    @ParameterConstant(
            params = {@ParameterConstantEntry(key = "length", value = "8")}
    )
    @GetUrl(value = "/app/getRandomString")
    String getRandomString();

    @ParameterConstant(
            pathVariables = {@ParameterConstantEntry(key = "id", value = "8")}
    )
    @GetUrl(value = "/user/getUserById/{id}")
    ResultVO<User> getUserById();

    @ParameterConstant(
            body = "{\"id\":1111,\"age\":12,\"userName\":\"aaaa\",\"status\":true}"
    )
    @PutUrl(value = "/user/addUserInfo", contentType = ContentType.APPLICATION_JSON)
    ResultVO<Boolean> saveUserInfo();

}
